package com.person.controller;

import com.person.common.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.UUID;

@RestController
@RequestMapping("/paymentcontroller8006")
public class MyPaymentController {
    @Resource
    private DiscoveryClient discoveryClient;
    @Value("${spring.application.name}")
    private String server;

    @GetMapping("/find/{id}")
    public CommonResult get(@PathVariable("id") String id) {
        System.out.println(discoveryClient.getServices());
        return CommonResult.ok(200, "success", server + UUID.randomUUID().toString() + id);
    }
}
